from abc import ABC
from typing import Any


class OpenAICallbackHandler(ABC):
    """用于记录 OpenAI调用 时候的日志"""

    def on_reqeust_event(self,
                         body:Any="",
                         url:str="",
                         chat_id:int=None,
                         ** kwargs: Any,
                         ) -> str:
        """如果日志存储到数据库,则返回id"""
        pass

    def on_response_event(self,body:Any="",
                          id:str="",   #id: requestLog 调用的获得的id
                          **kwargs: Any,
                          ):
        """openai返回的信息"""
        pass